<template>
    <div class="chat-suggested max-width" v-if="isStreaming && list.length > 0">
        <el-divider>
            <span class="c-99">试着问问</span>
        </el-divider>
        <div class="item-container">
            <div v-for="item in list" :key="item" class="item" @click="handleClick(item)">
                {{ item }}
            </div>
        </div>
    </div>
</template>
<script setup>
const props = defineProps({
    list: {
        type: Array,
        default: () => [],
    },
    isStreaming: {
        type: Boolean,
        default: false,
    },
});

const emit = defineEmits(['send']);

const handleClick = (item) => {
    emit('send', item);
};

</script>
<style scoped lang="scss">
.chat-suggested {
    padding: 10px;

    .item-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .item {
        padding: 5px 10px;
        box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.11);
        height: 25px;
        display: flex;
        align-items: center;
        border-radius: 6px;
        font-size: 12px;
        cursor: pointer;
        color: #155aef;
        &:hover {
            background: #F9FAFB;
        }
    }
}
</style>
